﻿using System.Windows;
using System.Windows.Controls;

namespace OneWPFDome.UC;

//点击按钮通过反射show出窗体
public class LongButton:Button
{
    public Type SubLongWindow { set; get; }

    protected override void OnClick()
    {
        base.OnClick();
        
        //通过反射创建窗体
        var window = Activator.CreateInstance(SubLongWindow) as Window;
        window?.Show();
    }
}